/***********************************************************************************/
/*                                                                                 */
/*                                                                                 */
/*    @Project:Acme-ClusterMonitor                                                 */
/*    @ File Name : jconn.h                                                        */
/*    @ Date : 2011-8-5                                                            */
/*    @ Author : Li Chengyu                                                        */
/*    @Description : Incomming Conection header                                    */
/*                                                                                 */
/*                                                                                 */
/***********************************************************************************/

#ifndef JCONN_H
#define JCONN_H

#include <QTcpSocket>
#include <QTcpServer>
#include <QDateTime>
#include "datatype.h"
static const int bufSize=10240;

class JConn : public QTcpSocket
{
    Q_OBJECT
public:
    enum{
        Information,    //传送的为有效信息
        Control,         //传送的为控制信息
        Disconnect
    }ConnectionState;
    JConn(QObject *parent = 0);
    ~JConn();
    bool pending_read;
    JInfo info;
    QString tmp;
    void close();

signals:
    //void hostname_ready(JConn *);
    void data_ready();

public slots:
    void recv_slot();
    void disconnect_slot();
    //void connected_slot(QAbstractSocket::SocketState);

};
#endif // JCONN_H
